<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 800px;
            height: 20px;
            border-radius: 4px;
            margin: 100px auto;
            border: 2px solid green;
            position: relative;
        }

        #jinDuTiao {
            height: 20px;
            background: darkturquoise;
            border-radius: 4px;
            float: left;
        }

        #num {
            position: absolute;
            transform: translateY(-50%);
            top: 50%;
            left: 5px;
        }
    </style>
</head>
<body>
    <div class="box">
        <div id="jinDuTiao" style="width: 0px;"></div>
        <span id="num">0%</span>
    </div>
</body>
<script>
    var time = setInterval(function(){
        var style = parseInt(jinDuTiao.style.width);
        var curStyle = style + 10;
        if(curStyle >= 800){
            curStyle = 800;
            clearInterval(time);
        }
        jinDuTiao.style.width = curStyle + 'px';
        num.style.left = curStyle + 5 + 'px';
        num.innerHTML = ((curStyle/800) * 100).toFixed(2) + '%'
        
    },100)
</script>
</html>